<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		 <base href="<%=basePath%>">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<link href="css/content.css" rel="stylesheet">
		<link  href="css/footer.css" rel="stylesheet">
		<script type="text/javascript" src="js/jquery-3.4.1.js"></script>
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/validate.js"></script>
			
		<script type="text/javascript">
			if(${sessionScope.setflag}==1){
				alert("修改成功，请重新登录");
			}
			
			
		</script>
		<meta charset="utf-8">
		<title>登录页面</title>
	</head>
	<body>
	<c:remove var="setflag"/>
			<!-- 导入导航栏 -->
		<jsp:include page="/common/header.jsp"></jsp:include>
			<!-- 分割 -->
		<div style="height: 20px;"></div>
		<!--内容-->
		<div class="big_czmm_content">
			<div class="denglu_content">
				<div class="biaoti">
					<a class="zhong">个人登录</a>
					<a>企业登录</a>
				</div>
				<!--个人注册-->
				<div class="nr_box1 clearfix">
					<div class="nr clearfix">
						<div class="nr_left">
							<form action="person/login" method="post"  onsubmit="return check2()">
								<div class="nr_01">
									<div class="text">用户名</div>
									<input type="text" name="username"  class="input_00  " placeholder="邮箱/手机号" onblur="userdate(this.value)" />
								</div>
								<div class="tishi">
									<span id="erroruser"></span>
								</div>
								<div class="nr_01">
									<div class="text">密码</div>
									<input type="password"  name="password" class="input_00"  placeholder="密码"   onblur="psdate(this.value)"/>
								</div>
									<div class="tishi">
									<span id="errorps"></span>
								</div>
								<div class="nr_02">
									<input type="submit" value="立即注册" class="input_11">
								</div>
							</form>
						</div>
						<div class="nr_right">
							<div class="nr_03">
								<span>没有账号？</span>
								<a href="register.jsp">立即注册</a>
							</div>
						</div>
					</div>


					<!--企业登录-->
					<div class="nr dis_no clearfix">
						<div class="nr_left">
							<form action="company/login" method="post"  enctype="multipart/form-data" onsubmit="return check3()"  >
								<div class="nr_01">
									<div class="text">用户名</div>
									<input type="text" name="username"  class="input_00  " placeholder="邮箱/手机号" onblur="cuserdate(this.value)" />
								</div>
								<div class="tishi">
									<span id="cerroruser"></span>
								</div>
								<div class="nr_01">
									<div class="text">密码</div>
									<input type="password"  name="password" class="input_00"  placeholder="密码"   onblur="cpsdate(this.value)"/>
								</div>
									<div class="tishi">
									<span id="cerrorps"></span>
								</div>
								<input type="hidden" value="1" name="status">
								<div class="nr_02">
									<input type="submit" value="立即注册" class="input_11">
								</div>
								
								
							</form>
						</div>
						<div class="nr_right">
							<div class="nr_03">
								<span>还没公司账号？</span>
								<a href="register.jsp">立即注册</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 导入底部信息 -->
  	<jsp:include page="/common/footer.jsp"></jsp:include>
	
		<script type="text/javascript">
			$(function() {
				//选项卡and变色
				$(".denglu_content .biaoti a").click(function() {
					var index = $(this).index(".denglu_content .biaoti a");
					$(this).addClass("zhong").siblings().removeClass("zhong");
					$(".denglu_content .nr").eq(index).show().siblings().hide();
				});

				//input选中变色
				$(".denglu_content .nr_01 .input_00").focus(function() {
					$(".denglu_content .nr_01 .input_00").removeClass("input_lv");
					$(this).addClass("input_lv");
				});

			});
			//验证手机，显示手机验证码层
			function number(tt) {
				if (tt.match(/^1\d[0-9]{9}$/g)) {
					document.getElementById('error').innerText ="";
				} else {
						 document.getElementById('error').innerText ="请输入有效的邮箱地址/手机号";
				}
			};
			// 个人头像预览
			$("#avatar_file").change(function() {
				// 获取上传文件对象
				var file = $(this)[0].files[0];
				// 读取文件URL
				var reader = new FileReader();
				reader.readAsDataURL(file);
				// 阅读文件完成后触发的事件
				reader.onload = function() {
					// 读取的URL结果：this.result
					$("#avatar_img").attr("src", this.result);
				}
			});
			// 公司头像预览
			$("#avatar_file1").change(function() {
				// 获取上传文件对象
				var file = $(this)[0].files[0];
				// 读取文件URL
				var reader = new FileReader();
				reader.readAsDataURL(file);
				// 阅读文件完成后触发的事件
				reader.onload = function() {
					// 读取的URL结果：this.result
					$("#avatar_img1").attr("src", this.result);
				}
			});
			
		</script>
	</body>
</html>
